const routes = [
  {
    path: '/index',
    meta: { title: '首页' },
    component: () => import('../footer.vue'),
    // 二级路由
    children: [
      {
      path: '/index/home',
      name: 'home',
      component: () => import('../index/home.vue')
    },
    {
      path: '/index/baobao',
      name: 'baobao',
      meta: { title: '爆爆团' },
      component: () => import('../index/baobao.vue')
    }, 
    {
      path: '/index/order',
      name: 'order',
      meta: { title: '订单' },
      component: () => import('../index/order.vue'),
      // 重定向二级路由
      redirect:'/xz/all',
    }, 
    {
      path: '/index/my',
      name: 'my',
      meta: { title: '我的' },
      component: () => import('../index/my.vue')
    },
    {
      path: '/',
      redirect: '/index/home'
    },
    // 二级路由
    {
      path:'/xz',
      name:'全部',
      meta: { title: '全部' },
      component: () => import('../index/order.vue'),
      redirect:'/xz/all',
  children: [
    {
    path: '/xz/all',
    name: 'all',
    component: () => import('../all.vue')
  },
  {
    path: '/xz/pay',
    name: 'pay',
    component: () => import('../pay.vue')
  },
  {
    path: '/xz/sc',
    name: 'sc',
    component: () => import('../score.vue')
  },
  {
    path: '/xz/re',
    name: 're',
    component: () => import('../refund.vue')
  }
],
 },
    ]
  },
  {
    path: '/rejist',//注册页
    name: 'rejist',
    meta: { title:'注册页' },
    component: () => import('../rejist.vue'),
  },
  {
    path: '/login',//登录页
    name: 'login',
    meta: { title:'登录页' },
    component: () => import('../login.vue'),
  },
  {
    path:'/shouhuo',
    meta:{
        title:'收货地址'
    },
    component:()=>import('../address.vue')
},
{
  path:'/newhuo',
  meta:{
      title:'新增地址'
  },
  component:()=>import('../newaddress.vue')
},
// {
//   path:'/bianji',
//   meta:{
//       title:'删除地址'
//   },
//   component:()=>import('../bianjiaddress.vue')
// },
    {
      path: '/',
      redirect:'/index' //重定向
    },
    {
      path:'*',
      component: () => import('../not.vue'),
    },  
]
export default routes;